import request from 'umi-request';
let url = '';
// 作业评估模块
// http://69.234.218.75:8197/api/api-telematics-pc/doc.html#/default/pc%E4%BD%9C%E4%B8%9A%E8%AF%84%E4%BC%B0%E6%A8%A1%E5%9D%97/deleteUsingPUT

// 删除作业评估中某项值
export const WorkAssessDelete = () => {
  return request(`/api/api-telematics-pc/v1/taskevaluation/delete/{id}`, {
    method: 'put',
  });
};

// 获取面积列表
export const getOperatedAreaList = (params: OperatedSpeedsParams) => {
  return request(`/api/api-telematics-pc/v1/taskevaluation/getOperatedAreaList`, {
    method: 'get',
    params,
  });
};

// 获取耕深列表
export const getOperatedDepths = (params: OperatedSpeedsParams) => {
  return request(`/api/api-telematics-pc/v1/taskevaluation/getOperatedDepths`, {
    method: 'get',
    params,
  });
};

// 获取速度列表
// deviceId	设备code
// taskId	任务id
// startDate	任务开始时间，格式yyyy-MM-dd HH:mm:ss
// endDate	任务结束时间 格式yyyy-MM-dd HH:mm:ss
export interface OperatedSpeedsParams {
  deviceId: string;
  taskId: string;
  startDate: string;
  endDate: string;
}
export const getOperatedSpeeds = (params: OperatedSpeedsParams) => {
  return request(`/api/api-telematics-pc/v1/taskevaluation/getOperatedSpeeds`, {
    method: 'get',
    params,
  });
};

// 作业评估记录
export const getTaskEvaluationRecords = (taskId: string) => {
  return request(`/api/api-telematics-pc/v1/taskevaluation/getTaskEvaluationRecords/${taskId}`, {
    method: 'get',
  });
};
// 作业评估记录详情
export const getTaskEvaluationRecordsDetail = (taskId: string) => {
  return request(
    `/api/api-telematics-pc/v1/taskevaluation/getTaskEvaluationRecordsDetail/${taskId}`,
    {
      method: 'get',
    },
  );
};
// 作业图片分页列表
// curPage	当前页
// pageSize	分页大小
// taskId	作业任务id
// position	摄像头位置 0-前摄 1-后摄 3-左侧 4-右侧
export interface WorkAssessPageListParams {
  curPage: number;
  pageSize: number;
  taskId: number;
  position: number;
}
export const WorkAssessPageList = (params: WorkAssessPageListParams) => {
  return request(`/api/api-telematics-pc/v1/operateTaskImg/pageList`, {
    method: 'get',
    params,
  });
};

// 批量评估
export const batchUpdate = (body: any) => {
  return request(`/api/api-telematics-pc/v1/taskevaluation/batchUpdate`, {
    method: 'post',
    data: body,
  });
};

// 获取监控页面作业信息
// taskId	任务id
export interface MonitorOperateTaskParams {
  taskId: string;
}
export const getMonitorOperateTask = (params: MonitorOperateTaskParams) => {
  return request(`/api/api-telematics-pc/v1/monitoroperatetask/getMonitorOperateTask`, {
    method: 'get',
    params,
  });
};

// 分页获取工况消息列表
// https://swagger-doc.farmbgy.com/doc.html#/%E4%B8%9A%E5%8A%A1%E6%9C%8D%E5%8A%A1-%E8%BD%A6%E8%81%94%E7%BD%91PC%E6%8E%A5%E5%8F%A3%E6%9C%8D%E5%8A%A1/pc%E4%BD%9C%E4%B8%9A%E7%9B%91%E6%8E%A7%E6%A8%A1%E5%9D%97/getMachineryMessageByPageUsingGET
// deviceId	设备code
// taskId	任务id
// startDate	任务开始时间，格式yyyy-MM-dd HH:mm:ss
// endDate	任务结束时间 格式yyyy-MM-dd HH:mm:ss
// curPage	当前页
// pageSize	页大小
export interface MachineryMessageByPageParams {
  deviceId: string;
  taskId: string;
  startDate: string;
  endDate: string;
  curPage: number;
  pageSize: number;
}
export const getMachineryMessageByPage = (params: MachineryMessageByPageParams) => {
  return request(`/api/api-telematics-pc/v1/monitoroperatetask/getMachineryMessageByPage`, {
    method: 'get',
    params,
  });
};
// 作业记录列表查询
// https://swagger-doc.farmbgy.com/doc.html#/%E4%B8%9A%E5%8A%A1%E6%9C%8D%E5%8A%A1-%E8%BD%A6%E8%81%94%E7%BD%91PC%E6%8E%A5%E5%8F%A3%E6%9C%8D%E5%8A%A1/%E5%86%9C%E6%9C%BA%E8%B0%83%E5%BA%A6%E4%BD%9C%E4%B8%9A%E7%9B%B8%E5%85%B3%E6%8E%A5%E5%8F%A3/queryTaskInfoListUsingGET
export interface queryTaskInfoListParams {
  taskId?: string;
  typeName?: string;
  startTime?: string;
  endTime?: string;
  curPage: number;
  pageSize: number;
}
export const queryTaskInfoList = (params: queryTaskInfoListParams) => {
  return request(`/api/api-telematics-pc/v1/machinerytask/queryTaskInfoList`, {
    method: 'get',
    params,
  });
};
// 农机状态
export interface machineryStatusParams {
  faultStatus?: string;
  keyWord?: string;
  machineryIds: string;
  terminalStatus?: string;
}
export const machineryStatus = (params: machineryStatusParams) => {
  return request(`/api/api-telematics-pc/v1/machineryImplCombi/list`, {
    method: 'get',
    params,
  });
};

// 查询页面中作业类型下拉接口,显示全部
// https://swagger-doc.farmbgy.com/doc.html#/%E4%B8%9A%E5%8A%A1%E6%9C%8D%E5%8A%A1-%E8%BD%A6%E8%81%94%E7%BD%91PC%E6%8E%A5%E5%8F%A3%E6%9C%8D%E5%8A%A1/%E5%86%9C%E6%9C%BA%E8%B0%83%E5%BA%A6%E4%BD%9C%E4%B8%9A%E7%9B%B8%E5%85%B3%E6%8E%A5%E5%8F%A3/getAllTaskCategoryUsingGET
export const getAllTaskCategory = () => {
  return request(`/api/api-telematics-pc/v1/machinerytask/getAllTaskCategory`, {
    method: 'get',
  });
};

// 设备故障信息字典列表
//https://swagger-doc.farmbgy.com/doc.html#/%E5%9F%BA%E7%A1%80%E6%9C%8D%E5%8A%A1-iot%E5%B9%B3%E5%8F%B0%E6%9C%8D%E5%8A%A1/%E8%AE%BE%E5%A4%87%E6%95%85%E9%9A%9C%E6%B6%88%E6%81%AF%E5%AE%9E%E4%BD%93%E6%8E%A7%E5%88%B6%E5%99%A8/getFailureDictListUsingGET
export interface getFailureDictListParams {
  id: string;
}
export const getFailureDictList = ({ id }: getFailureDictListParams) => {
  return request(`/api-iot-server/v3/machine-failure-message/getFailureDictList/${id}`, {
    method: 'get',
  });
};
// 设备故障消息列表
// https://swagger-doc.farmbgy.com/doc.html#/%E5%9F%BA%E7%A1%80%E6%9C%8D%E5%8A%A1-iot%E5%B9%B3%E5%8F%B0%E6%9C%8D%E5%8A%A1/%E8%AE%BE%E5%A4%87%E6%95%85%E9%9A%9C%E6%B6%88%E6%81%AF%E5%AE%9E%E4%BD%93%E6%8E%A7%E5%88%B6%E5%99%A8/getFailureTypeListUsingGET
export interface getFailureInfoListParams {
  machineNameMt?: string;
  typeCode?: string;
  pageSize?: number;
  pageIndex?: number;
}
export const getFailureInfoList = (body: getFailureInfoListParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-failure-message/getFailureInfoList`,
    {
      method: 'post',
      data: body,
    },
  );
};
// 设备故障类型字典列表
// https://swagger-doc.farmbgy.com/doc.html#/%E5%9F%BA%E7%A1%80%E6%9C%8D%E5%8A%A1-iot%E5%B9%B3%E5%8F%B0%E6%9C%8D%E5%8A%A1/%E8%AE%BE%E5%A4%87%E6%95%85%E9%9A%9C%E6%B6%88%E6%81%AF%E5%AE%9E%E4%BD%93%E6%8E%A7%E5%88%B6%E5%99%A8/getFailureTypeListUsingGET
export const getFailureTypeList = () => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-failure-message/getFailureTypeList`,
    {
      method: 'get',
    },
  );
};
// 新增电子围栏设置
// https://swagger-doc.farmbgy.com/doc.html#/%E5%9F%BA%E7%A1%80%E6%9C%8D%E5%8A%A1-%E6%8A%A5%E8%AD%A6%E6%8E%A5%E5%8F%A3%E6%9C%8D%E5%8A%A1/%E8%AE%BE%E5%A4%87%E6%8A%A5%E8%AD%A6%E6%8E%A7%E5%88%B6%E5%99%A8/addAlarmElectronicFenceUsingPOST
export interface addAlarmElectronicFenceParams {
  code?: string;
  constraintsTimeEnd?: string;
  constraintsTimeStart?: number;
  fence?: string;
  machineCodes?: string;
  machineNames?: string;
  name?: string;
  ncuCodes?: string;
  remark?: string;
  status?: number;
  type?: number;
}
export const addAlarmElectronicFence = (body: addAlarmElectronicFenceParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/addAlarmElectronicFence`,
    {
      method: 'post',
      data: body,
    },
  );
};
// 新增阈值设置
export interface addThresholdParams {
  fieldList?: [
    {
      code: string;
      duration: number;
      name: string;
      type: number;
      unit: string;
      value: string;
    },
  ];
  // deviceSpuId?: string,
  machineCode?: string;
  // machineName?: string,
  // machineTypeCode?: string,
  // machineTypeName?: string,
  // equipmentModel?: string,
}
export const addThreshold = (body: addThresholdParams) => {
  return request(`/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/addThreshold`, {
    method: 'post',
    data: body,
  });
};
// 查询电子围栏设置数据-分页
export interface getAlarmElectronicFencePageParams {
  status?: string;
  typeCode?: string;
  pageSize?: number;
  pageIndex?: number;
}
export const getAlarmElectronicFencePage = (body: getAlarmElectronicFencePageParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/getAlarmElectronicFencePage`,
    {
      method: 'post',
      data: body,
    },
  );
};
// 查询阈值设置项数据
export interface getThresholdFieldListParams {
  id?: string;
}
export const getThresholdFieldList = (body: getThresholdFieldListParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/getThresholdFieldList?id=` +
      body.id,
    {
      method: 'get',
    },
  );
};
// 查询阈值设置数据-分页
export interface getThresholdPageParams {
  machineNameMt?: string;
  typeCode?: string;
  pageSize: number;
  pageIndex: number;
}
export const getThresholdPage = (body: getThresholdPageParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/getThresholdPage`,
    {
      method: 'post',
      data: body,
    },
  );
};
// 更新电子围栏设置
export interface updateAlarmElectronicFenceParams {
  code?: string;
  constraintsTimeEnd?: string;
  constraintsTimeStart?: number;
  fence?: string;
  machineCodes?: string;
  machineNames?: string;
  name?: string;
  ncuCodes?: string;
  remark?: string;
  status?: number;
  type?: number;
  id?: string;
}
export const updateAlarmElectronicFence = (body: updateAlarmElectronicFenceParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/updateAlarmElectronicFence`,
    {
      method: 'post',
      data: body,
    },
  );
};
// 更新阈值设置
export interface updateThresholdParams {
  fieldList?: [
    {
      code: string;
      duration: number;
      name: string;
      type: number;
      unit: string;
      value: string;
    },
  ];
  id?: string;
  // machineName?: string,
  // machineTypeCode?: string,
  // machineTypeName?: string
}
export const updateThreshold = (body: updateThresholdParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/updateThreshold`,
    {
      method: 'post',
      data: body,
    },
  );
};

// 查询报警记录-分页
export interface getMachineAlarmInfoParams {
  machineNameMt?: string;
  pageIndex?: number;
  pageSize?: number;
  type?: string;
}
export const getMachineAlarmInfo = (body: getMachineAlarmInfoParams) => {
  return request(
    `/api/api-telematics/api-alarm-server/v3/machine-alarm-message/getMachineAlarmInfo`,
    {
      method: 'post',
      data: body,
    },
  );
};
// 查询报警记录详情列表
export interface getMachineAlarmInfoListParams {
  code?: string;
  taskId?: string;
}
export const getMachineAlarmInfoList = (body: getMachineAlarmInfoListParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/getMachineAlarmInfoList`,
    {
      method: 'post',
      data: body,
    },
  );
};

// 获取设备列表
export interface getDeviceListParams {
  category: number;
}
export const getDeviceList = ({ category }: getDeviceListParams) => {
  return request(`/api/api-telematics-pc/api-base-info/v3/machine/category/list/${category}`, {
    method: 'get',
  });
};

// 业务-分页获取列表
export interface getPageParams {
  code?: string;
  deleted?: string;
  deviceSpuId?: string;
  name?: string;
  note?: string;
  pageIndex?: string;
  pageSize?: string;
  status?: string;
}
export const getPage = (body: getPageParams) => {
  return request(`/api/api-telematics-pc/api-base-info/v3/baseinfo/deviceSku/getPage`, {
    method: 'post',
    data: body,
  });
};

// 获取阈值设置参数信息
export interface getAlarmParamByCodeParams {
  machineTypeCode: string;
}
export const getAlarmParamByCode = ({ machineTypeCode }: getAlarmParamByCodeParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/getAlarmParamByCode/${machineTypeCode}`,
    {
      method: 'get',
    },
  );
};

// 根据taskId获取路径规划信息
export interface getPointListParams {
  taskId: string;
}
export const getPointList = ({ taskId }: getPointListParams) => {
  return request(`/api/api-telematics-pc/v1/machinerytask/getPointList/${taskId}`, {
    method: 'get',
  });
};

// 获取当前的耕深、油耗、总面积统计
export const getOperatedStatistics = (params: OperatedSpeedsParams) => {
  return request(`/api/api-telematics-pc/v1/monitoroperatetask/getOperatedStatistics`, {
    method: 'get',
    params: params,
  });
};

// 获取故障报警信息
export const getWarningMessageList = (taskId: string) => {
  return request(`/api/api-telematics-pc/v1/monitoroperatetask/getWarningMessageList/${taskId}`, {
    method: 'get',
  });
};

// 更新电子围栏设置状态
export interface updateAlarmElectronicFenceStatusParams {
  status: number;
  id: string;
}
export const updateAlarmElectronicFenceStatus = (body: updateAlarmElectronicFenceStatusParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/updateAlarmElectronicFenceStatus`,
    {
      method: 'post',
      data: body,
    },
  );
};
// 更新阈值项设置状态
// https://swagger-doc.farmbgy.com/doc.html#/%E5%9F%BA%E7%A1%80%E6%9C%8D%E5%8A%A1-%E6%8A%A5%E8%AD%A6%E6%8E%A5%E5%8F%A3%E6%9C%8D%E5%8A%A1/%E8%AE%BE%E5%A4%87%E6%8A%A5%E8%AD%A6%E6%8E%A7%E5%88%B6%E5%99%A8/updateThresholdStatusUsingPOST
export interface updateThresholdStatusParams {
  status: number;
  id: string;
}
export const updateThresholdStatus = (body: updateThresholdStatusParams) => {
  return request(
    `/api/api-telematics-pc/api-alarm-server/v3/machine-alarm-message/updateThresholdStatus`,
    {
      method: 'post',
      data: body,
    },
  );
};

// 运行记录-获取农机基础信息及终端信息
export async function getBaseInfoById(id: string) {
  return request<API.ResponseMessagePagerResultDeviceVo>(
    `/api/api-telematics/v1/machinedata/getBaseInfoById/${id}`,
    {
      method: 'GET',
    },
  );
}

export const add = (data: any) => {
  return request(`/api/api-telematics/v1/implementdata/add`, {
    method: 'POST',
    data,
  });
};
export const del = (id: string) => {
  return request(`/api/api-telematics/v1/implementdata/deelete/${id}`, {
    method: 'DELETE',
    // data,
  });
};
export const getByPage = (data: any) => {
  return request(`/api/api-telematics/v1/implementdata/getByPage`, {
    method: 'POST',
    data,
  });
};
export const getImplementsSpupInfos = (data: any) => {
  return request(`/api/api-telematics/v1/implementdata/getImplementsSpupInfos`, {
    method: 'GET',
    params: data,
  });
};
export const getInfoById = (id: string) => {
  return request(`/api/api-telematics/v1/implementdata/getInfoById/${id}`, {
    method: 'GET',
    // params: data,
  });
};
export const update = (data: any) => {
  return request(`/api/api-telematics/v1/implementdata/update`, {
    method: 'PUT',
    data,
  });
};
export const getDviceCategorys = () => {
  return request(`/api/api-telematics/v1/implementdata/getDviceCategorys`, {
    method: 'GET',
    // params: data,
  });
};
// https://swagger-doc.farmbgy.com/doc.html#/%E4%B8%9A%E5%8A%A1%E6%9C%8D%E5%8A%A1-%E8%BD%A6%E8%81%94%E7%BD%91PC%E6%8E%A5%E5%8F%A3%E6%9C%8D%E5%8A%A1/%E5%86%9C%E6%9C%BA%E6%8E%A7%E5%88%B6%E5%99%A8/addMachineUsingPOST
export const addMachine = (data: any) => {
  return request(`/api/api-telematics/api-base-info/v3/machine/addMachine`, {
    method: 'POST',
    data,
  });
};
export const delMachine = (id: string) => {
  return request(`/api/api-telematics/api-base-info/v3/machine/delete/${id}`, {
    method: 'DELETE',
    // data,
  });
};
export const getMachineInfoById = (id: string) => {
  return request(`/api/api-telematics/api-base-info/v3/machine/getMachineInfoDetailsById/${id}`, {
    method: 'GET',
    // params: data,
  });
};
export const getMachinePage = (data: any) => {
  return request(`/api/api-telematics/api-base-info/v3/machine/getMachineInfoPage`, {
    method: 'POST',
    data,
  });
};
export const updateMachine = (data: any) => {
  return request(`/api/api-telematics/api-base-info/v3/machine/update`, {
    method: 'PUT',
    data,
  });
};
// https://swagger-doc.farmbgy.com/doc.html#/%E4%B8%9A%E5%8A%A1%E6%9C%8D%E5%8A%A1-%E8%BD%A6%E8%81%94%E7%BD%91%E5%90%8E%E7%AB%AF%E6%9C%8D%E5%8A%A1/%E5%93%81%E7%B1%BB%E6%8E%A7%E5%88%B6%E5%99%A8/getPageUsingPOST
export const addSpu = (data: any) => {
  return request(`/api/api-telematics/v3/baseinfo/device-spu/add`, {
    method: 'POST',
    data,
  });
};
export const delSpu = (id: string) => {
  return request(`/api/api-telematics/v3/baseinfo/device-spu/delete/${id}`, {
    method: 'DELETE',
    // data,
  });
};
export const getSpuInfoById = (id: string) => {
  return request(`/api/api-telematics/v3/baseinfo/device-spu/getById/${id}`, {
    method: 'GET',
    // params: data,
  });
};
export const getSpuPage = (data: any) => {
  return request(`/api/api-telematics/v3/baseinfo/device-spu/getPage`, {
    method: 'POST',
    data,
  });
};
export const getSpuCodeById = (id: string) => {
  return request(`/api/api-telematics/v3/baseinfo/device-spu/getSpuCodeById/${id}`, {
    method: 'GET',
    // data,
  });
};
export const getSpuCodeByModel = (id: string) => {
  return request(`/api/api-telematics/v3/baseinfo/device-spu/getSpuCodeByModel/${id}`, {
    method: 'GET',
    // data,
  });
};
export const updateSpu = (data: any) => {
  return request(`/api/api-telematics/v3/baseinfo/device-spu/update`, {
    method: 'PUT',
    data,
  });
};
export const getChilds = (data: any) => {
  return request(`/api/api-telematics/v3/device/category/getChilds`, {
    method: 'POST',
    data,
  });
};
export const getBrandList = () => {
  return request(`/api/api-telematics/v3/baseinfo/brand/getBrandList`, {
    method: 'GET',
  });
};
export const getList = (data: any) => {
  return request(`/api/api-telematics/v3/baseinfo/unit/getList`, {
    method: 'POST',
    data,
  });
};
// https://swagger-doc.farmbgy.com/doc.html#/%E4%B8%9A%E5%8A%A1%E6%9C%8D%E5%8A%A1-%E8%BD%A6%E8%81%94%E7%BD%91%E5%90%8E%E7%AB%AF%E6%9C%8D%E5%8A%A1/%E5%86%9C%E6%9C%BA%E7%BB%88%E7%AB%AF%E6%8E%A7%E5%88%B6%E5%99%A8/getTerminalInfoByConditionUsingGET_1
export const terminalAdd = (data: any) => {
  return request(`/api/api-telematics/api-iot-server/v3/machineTerminal/add`, {
    method: 'POST',
    data,
  });
};
export const deleteBatch = (data: any) => {
  return request(`/api/api-telematics/api-iot-server/v3/machineTerminal/deleteBatch`, {
    method: 'GET',
    params: data,
  });
};
export const getBondedTerminalInfoList = () => {
  return request(
    `/api/api-telematics/api-iot-server/v3/machineTerminal/getBondedTerminalInfoList`,
    {
      method: 'GET',
    },
  );
};
export const getDeviceInfoPage = (data: any) => {
  return request(`/api/api-telematics/api-iot-server/v3/machineTerminal/getDeviceInfoPage`, {
    method: 'POST',
    data,
  });
};
export const getTerminalInfoByCondition = (data: any) => {
  return request(
    `/api/api-telematics/api-iot-server/v3/machineTerminal/getTerminalInfoByCondition`,
    {
      method: 'GET',
      params: data,
    },
  );
};
export const getTerminalInfoModelList = () => {
  return request(`/api/api-telematics/api-iot-server/v3/machineTerminal/getTerminalInfoModelList`, {
    method: 'GET',
  });
};
export const terminalUpdate = (data: any) => {
  return request(`/api/api-telematics/api-iot-server/v3/machineTerminal/update`, {
    method: 'POST',
    data,
  });
};
export const getBySkuId = (data: any) => {
  return request(`/api/api-telematics/v3/baseinfo/device-sku-dynamic-attribute/getBySkuId`, {
    method: 'POST',
    data,
  });
};
// https://swagger-doc.farmbgy.com/doc.html#/%E4%B8%9A%E5%8A%A1%E6%9C%8D%E5%8A%A1-%E8%BD%A6%E8%81%94%E7%BD%91%E5%90%8E%E7%AB%AF%E6%9C%8D%E5%8A%A1/%E8%AE%BE%E5%A4%87%E5%8A%A8%E6%80%81%E5%B1%9E%E6%80%A7%E5%80%BC/updateUsingPUT
// {
//   "deviceSkuId": 0,
//   "id": 0,
//   "value": "",
//   "valueJson": ""
// }
export const updateAttr = (data: any) => {
  return request(`/api/api-telematics/v3/baseinfo/device-sku-dynamic-attribute/update`, {
    method: 'PUT',
    data,
  });
};
export const updateMAttr = (data: any) => {
  return request(`/api/api-telematics/v1/implementdata/updateDynamicAttribute`, {
    method: 'POST',
    data,
  });
};
// 分页查询企业
// https://iov-sit.farmbgy.com/api/api-telematics/doc.html#/default/%E4%BC%81%E4%B8%9A%E7%AE%A1%E7%90%86API/findConsumerCompanyPageUsingPOST
export const findConsumerCompanyPage = (data: any) => {
  return request(`/api/api-telematics/v1/consumercompany/findConsumerCompanyPage`, {
    method: 'POST',
    data,
  });
};
// 企业详情
export const findConsumerCompanyDetail = (companyId: any) => {
  return request(`/api/api-telematics/v1/consumercompany/findConsumerCompanyDetail/${companyId}`, {
    method: 'get',
  });
};
// 修改状态
export const updateCompanyStatus = (data: any) => {
  return request(`/api/api-telematics/v1/consumercompany/updateCompanyStatus`, {
    method: 'post',
    data,
  });
};
// 修改企业
export const updateConsumerCompany = (data: any) => {
  return request(`/api/api-telematics/v1/consumercompany/updateConsumerCompany`, {
    method: 'post',
    data,
  });
};
// 新增企业
export const addConsumerCompany = (data: any) => {
  return request(`/api/api-telematics/v1/consumercompany/addConsumerCompany`, {
    method: 'post',
    data,
  });
};
// 分配农机资源
export const allocateDevice = (data: any) => {
  return request(`/api/api-telematics/v1/consumercompany/allocateDevice`, {
    method: 'post',
    data,
  });
};
// 分配地图资源
export const allocateMaps = (data: any) => {
  return request(`/api/api-telematics/v1/consumercompany/allocateMaps`, {
    method: 'post',
    data,
  });
};
// 查询所有农场,返回已经分配过的数据List
export const findAllFarmList = (data: any) => {
  return request(`/api/api-telematics/v1/consumercompany/findAllFarmList`, {
    method: 'post',
    data,
  });
};
// 查询所有农机,返回已经分配过的数据List
export const findAllMachineList = (data: any) => {
  return request(`/api/api-telematics/v1/consumercompany/findAllMachineList`, {
    method: 'post',
    data,
  });
};
// 查询权限菜单
export const findPortalAlls = () => {
  return request(`/api/api-telematics/v1/consumercompany/findPortalAlls`, {
    method: 'get',
  });
};
